import { axios } from '@/utils/request'

export const getHospitalTree = (params) => {
  return axios({
    url: 'hospital/tree',
    method: 'get',
    params
  })
}

export const getHospitalById = (id) => {
  return axios({
    url: 'hospital/' + id,
    method: 'get'
  })
}

export const saveHospital = (data) => {
  return axios({
    url: 'hospital',
    method: 'post',
    data
  })
}

export const updateHospitalById = (id, data) => {
  return axios({
    url: 'hospital/' + id,
    method: 'put',
    data
  })
}

export const removeHospitalById = (id) => {
  return axios({
    url: 'hospital/' + id,
    method: 'delete'
  })
}
